package org.agent.aigccore.basic.model.request;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class BasePageRequest extends BaseRequest {

    /**
     * 页码大小
     */
    private int pageSize = 10;

    /**
     * 当前页从1开始，便于前段展示
     */
    private int pageNo = 1;

    /**
     * 获取当前页码
     *
     * @return
     */
    public int getPageNo() {
        if (pageNo <= 0) {
            pageNo = 1;
        }
        return pageNo;
    }

    /**
     * 获取当前页码，从0开始 (前段不要用此字段)
     *
     * @return
     */
    public int getPageNoBaseZero() {
        if (pageNo <= 0) {
            pageNo = 1;
        }
        return pageNo - 1;
    }
}
